/*
 * @FileName: [Jdk14LogImpl.java] 
 * @Package com.bcinfo.upp.log.impl 
 * 
 * 
 * Copyright (c) 2011-2015 BCINFO Technology Limited Com.
 * All rights reserved.
 * 
 * This software is the confidential and proprietary 
 * information of BCINFO Technology Limited Company
 * ("Confidential Information"). You shall not disclose 
 * such Confidential Information and shall use it only
 * in accordance with the terms of the contract agreement 
 * you entered into with RKY.
 * 
 * $Rev: 52 $
 * $LastChangedDate: 2013-11-25 11:41:03 +0800 (Mon, 25 Nov 2013) $
 * $LastChangedBy: wanggc $
 * 
 * @category bcinfo-
 * @version 1.1
 * @author $Author: wanggc $
 *
 * Change History:[Formatter: author date description] <br/>
 * 1
 * 2
 * 3
*/
package com.bcinfo.iccard.log.impl;

import java.util.logging.Level;
import java.util.logging.Logger;

import com.bcinfo.iccard.log.Log;


/**
 * LOG的服务封装类 <br/>
 * <p>Description:<br/>
 *    <p>封装传入Log的各个服务。
 *
 * <p>For Examples <br/>
 * <PRE>
 *      不建议直接使用
 * </PRE>
 * <p>
 */
public class Jdk14LogImpl implements Log
{

    public Jdk14LogImpl(Logger log)
    {
        _log = log;
    }

    public void debug(Object msg)
    {
        _log.log(Level.FINE, msg.toString());
    }

    public void debug(Throwable t)
    {
        _log.log(Level.FINE, t.getMessage(), t);
    }

    public void debug(Object msg, Throwable t)
    {
        _log.log(Level.FINE, msg.toString(), t);
    }

    public void error(Object msg)
    {
        _log.log(Level.SEVERE, msg.toString());
    }

    public void error(Throwable t)
    {
        _log.log(Level.SEVERE, t.getMessage(), t);
    }

    public void error(Object msg, Throwable t)
    {
        _log.log(Level.SEVERE, msg.toString(), t);
    }

    public void fatal(Object msg)
    {
        _log.log(Level.SEVERE, msg.toString());
    }

    public void fatal(Throwable t)
    {
        _log.log(Level.SEVERE, t.getMessage(), t);
    }

    public void fatal(Object msg, Throwable t)
    {
        _log.log(Level.SEVERE, msg.toString(), t);
    }

    public void info(Object msg)
    {
        _log.log(Level.INFO, msg.toString());
    }

    public void info(Throwable t)
    {
        _log.log(Level.INFO, t.getMessage(), t);
    }

    public void info(Object msg, Throwable t)
    {
        _log.log(Level.INFO, msg.toString(), t);
    }

    public boolean isDebugEnabled()
    {
        return _log.isLoggable(Level.FINE);
    }

    public boolean isErrorEnabled()
    {
        return _log.isLoggable(Level.SEVERE);
    }

    public boolean isFatalEnabled()
    {
        return _log.isLoggable(Level.SEVERE);
    }

    public boolean isInfoEnabled()
    {
        return _log.isLoggable(Level.INFO);
    }

    public boolean isTraceEnabled()
    {
        return _log.isLoggable(Level.FINEST);
    }

    public boolean isWarnEnabled()
    {
        return _log.isLoggable(Level.WARNING);
    }

    public void trace(Object msg)
    {
        _log.log(Level.FINEST, msg.toString());
    }

    public void trace(Throwable t)
    {
        _log.log(Level.FINEST, t.getMessage(), t);
    }

    public void trace(Object msg, Throwable t)
    {
        _log.log(Level.FINEST, msg.toString(), t);
    }

    public void warn(Object msg)
    {
        _log.log(Level.WARNING, msg.toString());
    }

    public void warn(Throwable t)
    {
        _log.log(Level.WARNING, t.getMessage(), t);
    }

    public void warn(Object msg, Throwable t)
    {
        _log.log(Level.WARNING, msg.toString(), t);
    }

    private Logger _log;

}